Sanity Check JSON String
(11 actions, 14 KB)
0 Replace Text
\
with
\\
in
[Shortcut Input]
γβ updatedText1
γΒ»
ReplaceTextCaseSensitive
:
false
1 Set Variable
myJsonString
to
[0 updatedText1]
2 Replace Text
\n
with
\\n
in
[myJsonString]
γβ updatedText2
γΒ»
ReplaceTextRegularExpression
:
true
ReplaceTextCaseSensitive
:
false
3 Set Variable
myJsonString
to
[2 updatedText2]
4 DictionaryγΒ»
5
6
{ "\"": "\\\"", "β": "\\\"", "β": "\\\"", "'": "\\'", "β": "\\'", "β": "\\'", "/": "\\/" }
5 Repeat with Each in
[4 Dictionary
βs Keys
]
6 Get Dictionary Value for
[Repeat Item]
in
[4 Dictionary]
γΒ»
7 Replace Text
[Repeat Item]
with
[6 Dictionary Value]
in
[myJsonString]
γΒ»
ReplaceTextCaseSensitive
:
false
8 Set Variable
myJsonString
to
[7 Updated Text]
9 End Repeat with Each
10 Stop and Output
[myJsonString]